package pms.device;


import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;

import pms.contract.service.GenericGenerator;
import pms.device.domain.Device;

public class DeviceEntityGenerator extends GenericGenerator {

	@Autowired
	DeviceManager deviceManager;

	@Test
	public void gen_device() 
	{
		for (int i = 0; i < 10; i++) 
		{
			Device device = new Device();
		    device.setDevice_name("device_name"+i);
			this.deviceManager.save(device);
			for (int j = 0; j < 10; j++) 
			{
				Device e = new Device();
	            e.setDevice_num("num"+i);
	            e.setDevice_place("place"+i);
				device = this.deviceManager.save(e);
				this.deviceManager.save(device);
			}
		}
	}
}
